﻿
; ----------------------------------------------
;        <<  声明常量  >>
; ----------------------------------------------
!define COMPANY         "Microld"
!define PRODUCT         "绿化工具"
!define URL             "http://i.qdz.me"

; 注册表
; Software\microld\node
; 在x64位系统下会指向 Software\Wow6432Node\microld\node
; 但不影响判断
!define GREEN_PATH_KEY "Software\microld"
!define SYSTEM_PATH_KEY "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"

!define  /date DATE "%m%d"
!define  Version "1.0.0.${DATE}"


; ----------------------------------------------
;        <<  声明变量  >>
; ----------------------------------------------
Var Microld


; ----------------------------------------------
;        <<  包含文件  >>
; ----------------------------------------------
!include Sections.nsh
!include MUI2.nsh         ; Modern UI
!include FileFunc.nsh     ; 文件函数
!include LogicLib.nsh     ; 逻辑函数
!include WordFunc.nsh     ; 文字函数
!include WinMessages.nsh  ; Windows API
!include WinCore.nsh

!include "Page.nsi"



; ----------------------------------------------
;        <<  其他  >>
; ----------------------------------------------
; 使7-Zip打开看不到其他内容。
!packhdr temp.dat 'cmd /c Copy /B temp.dat /B +resource\Microld.rar temp.dat'

; 提升安装程序权限(vista,win7,win8)
RequestExecutionLevel admin

; 输出文件
OutFile output\Green.exe

; 图标文件
!define MUI_ICON "extra\Green.ico"

; 语言
!insertmacro MUI_LANGUAGE "SimpChinese"

; 获取命令行参数
!insertmacro GetParameters

; 标题
Name "绿化工具"
Caption "$(^Name)"

; 覆盖
SetOverwrite on


; ----------------------------------------------
;        <<  版权信息  >>
; ----------------------------------------------
VIProductVersion "0.0.0.0"
VIAddVersionKey ProductName "${PRODUCT}"          ; 产品名称
VIAddVersionKey FileVersion "0.0.0.0"             ; 文件版本
VIAddVersionKey ProductVersion "0.0.0.0"          ; 产品版本
VIAddVersionKey FileDescription "描述"            ; 描述
VIAddVersionKey LegalCopyright "© 2015 Microld"   ; 版权
VIAddVersionKey LegalTrademarks "Microld"         ; 商标
VIAddVersionKey OriginalFilename "Green.exe"      ; 源文件名

VIAddVersionKey CompanyName "${COMPANY}"          ; 公司名
VIAddVersionKey CompanyWebsite "${URL}"           ; URL



; ----------------------------------------------
;        <<  区段  >>
; ----------------------------------------------
Section
  DetailPrint "Microld"
SectionEnd


; 调用自定义页面
Page custom fnc__Green_Show
;UninstPage custom fnc__Green_Show

; ----------------------------------------------
;        <<  初始化  >>
; ----------------------------------------------
Function .onInit
  ; 初始化 $PLUGINSDIR 目录
  InitPluginsDir
  SetOutPath $PLUGINSDIR
  File /r extra\*.*
  
  ; WriteUninstaller "%UNINSTALLER_FILENAME%"
  ;Quit
FunctionEnd


; ----------------------------------------------
;        <<  界面关闭后  >>
; ----------------------------------------------
Function .onGUIEnd
  SetOutPath $TEMP
  RMDir /r $PLUGINSDIR
FunctionEnd


Function un.onInit
	Nop
FunctionEnd
